<?php
   $mail   = ( isset( $_REQUEST[ 'email' ] ) )? $_REQUEST[ 'email' ]: "";
   $errors = ( isset( $_REQUEST[ 'errors' ] ) )? $_REQUEST[ 'errors' ]: array();
   if( !is_array( $errors ) ) $errors = array( $erros );
   $dir    = dirname( $_SERVER[ 'PHP_SELF' ] );
   if( substr( $dir, - 1 ) == "/" )
   {
      $dir = substr( $dir, 0, -1 );
   }
?>
<html>
   <head>
      <style type="text/css">
         #credentials {
           padding-top: 10%;
         }
         #credentials table {
           margin: auto;
         }
         #cred_container {
           text-align: center;
         }
         .error{ color:red;}
      </style>
   </head>
   <body>
      <div id="cred_container">
         <form id="credentials" method="POST" action="<?php echo $dir; ?>/validation.php" >
            <table>
               <?php foreach( $errors as $error ): ?>
               <tr>
                  <td colspan="2" class="error"><?php echo $error; ?></td>
               </tr>
               <?php endforeach; ?>
               <tr>
                  <td>Email address (username)</td><td><input type="text" name="user" value="<?php echo $mail; ?>" size="50"/></td>
               </tr>
               <tr>
                  <td>Password</td><td><input type="password" name="pass" value="" size="50"/></td>
               </tr>
               <tr>
                  <td>Password confirmation</td><td><input type="password" name="pass_conf" value="" size="50"/></td>
               </tr>
               <tr>
                  <td></td><td><input type="submit" value="Submit"/></td>
               </tr>
            </table>
         </form>
	<p>For your own safety, be sure <em>not</em> to use a password which you would use at some other website.</p>
      </div>
   </body>
</html>
